/*
 */
package org.vectrics.recruiter.user.resume;

import java.util.Locale;

import org.vectrics.batch.Batch;
import org.vectrics.domain.Domain;
import org.vectrics.recruiter.RecruitServiceLocator;
import org.vectrics.recruiter.user.RecruitUserProvider;
import org.vectrics.recruiter.user.ResumeScanBatch;



/**
 * @author mmoore
 */
public class ResumeScanRun extends Batch {
    private ResumeScanBatch batch;
    private String BATCH_TYPE_CODE = "resume-scan-batch";
    private Locale locale = null;

    public ResumeScanRun(Domain domain, ResumeScanBatch batch, Locale locale) {
        super(domain);
    	this.batch = batch;
        this.locale = locale;
    }

    protected boolean persistRunResults() {
		return(false);
	}
    
	protected boolean logOnlyErrors() {
		return(true);
	}
    
    public boolean hasOtherRunningInstance() {
    	return(false);
    }
    
    public String getBatchTypeCode() {
    	return(BATCH_TYPE_CODE);
    }
    
    public String getDescription() {
    	String desc = "Scanning resumes for scan batch: " + batch.getDescription() + "  User: " +
			batch.getRunPerson().getName();
    	return(desc);
    }
    
	protected boolean executeForEachDomain() {
		return(false);
	}
    
    /*
     * 
     */
    public void execute(Domain domain) {
    	RecruitServiceLocator.getRecruitUserService().performResumeScan(batch);
    }
    
}
